<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Elisa3: sensors.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Elisa3
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('sensors_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">sensors.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="sensors_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 <span class="preprocessor">#ifndef SENSORS_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#define SENSORS_H</span>
<a name="l00004"></a>00004 <span class="preprocessor"></span>
<a name="l00005"></a>00005 
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;<a class="code" href="variables_8h.html">variables.h</a>&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;avr\io.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;<a class="code" href="leds_8h.html" title="Leds module.">leds.h</a>&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;<a class="code" href="twimaster_8h.html">twimaster.h</a>&quot;</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00031"></a>00031 <span class="preprocessor">    #include &lt;math.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#endif</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="sensors_8c.html#a11b381faabbecc0143d11cf09e955462" title="Calibrate all the sensors (proximity, ground and accelerometer). Pay attention for the robot to be po...">calibrateSensors</a>();
<a name="l00041"></a>00041 
<a name="l00046"></a>00046 <span class="keywordtype">void</span> <a class="code" href="sensors_8c.html#a3d961b25677384479fcd0d413da8ef83" title="Test which device is mounted on the robot and configure it.">initAccelerometer</a>();
<a name="l00047"></a>00047 
<a name="l00053"></a>00053 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="sensors_8c.html#afe99cfb7d3e16bf36cc5d29da66ce8bc" title="Configure the ADXL345 accelerometer (2g sensitivity, 10 bits resolution).">initADXL345</a>();
<a name="l00054"></a>00054 
<a name="l00060"></a>00060 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="sensors_8c.html#a00ac3777f39d082d583911fcedd3a302" title="Configure the MMA74565L accelerometer (2g sensitivity, 10 bits resolution).">initMMA7455L</a>();
<a name="l00061"></a>00061 
<a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="sensors_8c.html#a9c7a0d4e693d6dd1fef72e28353324a1" title="Request the X and Y values (10 bit data, 2&#39;s complement) and save them in their respective global var...">readAccelXY</a>();
<a name="l00068"></a>00068 
<a name="l00074"></a>00074 <span class="keywordtype">void</span> <a class="code" href="sensors_8c.html#ab3ef74e35beb0d06aefb2830ff49862d" title="Request the X, Y and Z values (10 bit data, 2&#39;s complement) and save them in their respective global ...">readAccelXYZ</a>();
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 <span class="comment">// the following two functions split &quot;readAccelXYZ&quot;, used with aseba.</span>
<a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="sensors_8c.html#a2d993650e0a974e422727cb262f782ad">readAccelXYZ_1</a>();
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="sensors_8c.html#ab53b8f8a6ca993a60fc2377d0bfd2476">readAccelXYZ_2</a>();
<a name="l00079"></a>00079 
<a name="l00089"></a>00089 <span class="keywordtype">void</span> <a class="code" href="sensors_8c.html#a12fc697a01e1d04b91df358a472b5b84" title="Compute the angle of the robot using the X and Y axes; the resulting angle is saved in the global var...">computeAngle</a>();
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span>} <span class="comment">// extern &quot;C&quot;</span>
<a name="l00093"></a>00093 <span class="preprocessor">#endif</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span>
<a name="l00095"></a>00095 <span class="preprocessor">#endif</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span>
</pre></div></div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="sensors_8h.html">sensors.h</a>      </li>

    <li class="footer">Generated on Thu Dec 4 2014 08:30:46 for Elisa3 by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
